<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <!-- 搜索 -->
      <el-input
        v-model="queryForm.tableName"
        clearable
        size="small"
        placeholder="请输入库名"
        style="width:200px"
        class="filter-item"
      />
      <rrOperation :crud="crud"/>
    </div>
    <!--表格渲染-->
    <el-table
      ref="table"
      v-loading="crud.loading"
      :data="tableList"
      border
      @select="crud.selectChange"
      @select-all="crud.selectAllChange"
      @selection-change="crud.selectionChangeHandler"
    >
      <el-table-column label="库名" prop="dbName"/>
      <el-table-column label="表名" prop="tabelName"/>
      <el-table-column label="状态" prop="status"/>
      <el-table-column label="开始时间" prop="startTime"/>
      <el-table-column label="结束时间" prop="endTime"/>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-tag @click="lookDetail(scope.row)">错误信息</el-tag>
        </template>
      </el-table-column>
    </el-table>
    <div style=" float: right;">
      <!--分页组件-->
      <pagination />
    </div>

  </div>
</template>

<script>
import CRUD, {presenter, header, form, crud} from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
// crud交由presenter持有
const defaultCrud = CRUD({title: '', url: '', crudMethod: {}})
const defaultForm = {
  id: null,
  dbName: null,
  tableNameList: []
}
export default {
  name: 'DisasterRecoveryLog',
  components: {rrOperation, pagination},
  mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
  data() {
    return {
      queryForm: {
        name: '',
        code: '',
      },
      rules: {
        dbName: [
          { required: true, message: '清选择库名', trigger: 'blur' }
        ],
        tableNameList: [
          { required: true, message: '请选择表名', trigger: 'blur' }
        ],
      },
      tableList: [
        {
          dbName: 'sdata',
          tableName: 'customer_info'
        }
      ],
    }
  },
  created(){
  },
  methods: {
    lookDetail(data){

    }
  }
}
</script>
<style scoped>

</style>
